package com.itheima.dao;

import com.itheima.domain.User;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface UserMapper {
    //查询所有用户
    @Select("select * from user")
    List<User> findAll();


    //根据ID查询用户
    @Select("select * from user where id = #{id}")
    User findById(int id);


    //更新用户信息
    @Update("update user set username = #{username},password = #{password},sex = #{sex},age = #{age},email = #{email} where id = #{id}")
    void updateUser(User user);
}